<?php

//	Author: 	Aris Michail
//	Email:		std03055@di.uoa.gr
//	Purpose: 	Restore a soft deleted a category

require_once ("../DB/connection.php");
require_once ("../DB/defines.php");
require_once ("../Frameworks/Objects/user.php");
require_once ("../Frameworks/Objects/category.php");
require_once ("../Frameworks/Objects/attribute.php");

function DB_restoreCategory($categoryid)
{

    global $conn;

    // The name of the stored procedure
    $sp_name = "usp_category_restore_category";

    // The return variable
    $retval;

    // Create a new statement
    $stmt = mssql_init($sp_name, $conn);

    // Bind values
    mssql_bind($stmt, "RETVAL", $retval, SQLINT4, true, false, 1);
    mssql_bind($stmt, '@CatToRestoreID', $categoryid, SQLINT4, false, false, 1);

    // Execute the statement
    $status = mssql_execute($stmt);
    if ($status)
        return DB_OK;
}

?>